<?php
/**
 * Created by PhpStorm.
 * User: micoya
 * Date: 2018/11/29
 * Time: 2:24 PM
 */

namespace app\index\controller;


use app\common\base\AuthenticatedController;
use app\common\base\Form;
use think\Controller;
use think\Db;
use think\Error;

class DeviceClassifyController extends Controller {

    public function GetList() {
        $result = Db::table('device_classify')->select();

        return Success('获取成功', $result);
    }


    public function GetOne() {
        Form::Validate([
            'id'    =>  'require|integer'
        ]);

        $result = Db::table('device_classify')->where('id', input('id'))->find();
        if (!$result) {
            return Error('获取失败');
        }

        return Success('获取成功', $result);

    }

}